<form method="post" action="#" class="form-horizontal">
    <h3>Form Biodata Alumni</h3>
    <fieldset class="">
        <div class="control-group">
            <label for="txtNama" class="control-label">Nama:</label>
            <div class="controls">
                <input type="text" name="txtNama" id="txtNama" value="<?= @$alumni->up_fullname ?>" class="span4"/>
                <font class="strerr"><?= @$err->up_fullname ?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtAlias" class="control-label">Nama Panggilan:</label>
            <div class="controls">
                <input type="text" name="txtAlias" id="txtAlias" value="<?= @$alumni->up_display_name ?>" class="span3"/>
            <font class="strerr"><?=@$err->up_display_name?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddAngkatan" class="control-label">Angkatan:</label>
            <div class="controls">
                <select name="ddAngkatan" id="ddAngkatan">
                    <option value="">Select</option>
                    <? foreach (getAngkatan() as $r) { ?>
                        <option value="<?= @$r->angkatan_year ?>"<?= @$alumni->up_graduate_year == $r->angkatan_year ? ' selected="selected"' : "" ?>><?= $r->angkatan_name ?></option>
                    <? } ?>
                </select>
                <font class="strerr"><?=@$err->up_graduate_year?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddJenkel" class="control-label">Jenis Kelamin:</label>
            <div class="controls">
                <select name="ddJenkel" id="ddJenkel" class="span2">
                    <option value="L"<?= @$alumni->up_gender == "L" ? ' selected="selected"' : "" ?>>Laki-laki</option>
                    <option value="P"<?= @$alumni->up_gender == "P" ? ' selected="selected"' : "" ?>>Perempuan</option>
                </select>
                <font class="strerr"><?=@$err->up_gender?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtPob" class="control-label">Tempat Lahir:</label>
            <div class="controls">
                <input type="text" name="txtPob" id="txtPob" value="<?= @$alumni->up_birth_place ?>"/>
                <font class="strerr"><?=@$err->up_birth_place?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtDob" class="control-label">Tanggal Lahir:</label>
            <div class="controls">
                <div class="input-append date" id="dpYears" data-date="2012-12-12" data-date-format="yyyy-mm-dd" data-date-viewmode="years">
                    <input type="text" name="txtDob" class="span2" value="<?= @$alumni->up_birth_date ?>" size="16" value="2012-12-12" readonly=""/>
                    <span class="add-on"><i class="icon-calendar"></i></span>
                </div>
                <font class="strerr"><?= @$err->up_birth_date ?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddStatus" class="control-label">Status:</label>
            <div class="controls">
                <select name="ddStatus" id="ddStatus" class="span2">
                <? foreach (arrStatus() as $k => $v) { ?>
                    <option value="<?= $k ?>"<?= @$alumni->up_status == $k ? ' selected="selected"' : "" ?>><?= $v ?></option>
                <? } ?>
                </select>
                <font class="strerr"><?=@$err->up_status?></font>
            </div>
        </div>
        
        <div class="control-group">
            <label for="txtPhone" class="control-label">Telp:</label>
            <div class="controls">
                <input type="text" name="txtPhone" id="txtPhone" value="<?= @$alumni->up_phone ?>"/>
                <font class="strerr"><?=@$err->up_phone?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtEmail" class="control-label">Email:</label>
            <div class="controls">
                <input type="text" name="txtEmail" id="txtEmail" value="<?= @$alumni->up_email ?>"/>
                <font class="strerr"><?=@$err->up_email?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtAlamatdomisili" class="control-label">Alamat Domisili:</label>
            <div class="controls">
                <input type="text" name="txtAlamatdomisili" id="txtAlamatdomisili" value="<?= @$alumni->up_address ?>" class="span4"/>
                <font class="strerr"><?=@$err->up_address?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddPropinsidomisili" class="control-label">Propinsi Domisili:</label>
            <div class="controls">
                <select name="ddPropinsidomisili" id="ddPropinsidomisili">
                <option value="">Select</option>
                <? foreach (getPropinsi() as $r) { ?>
                    <option value="<?= $r->province_id ?>"<?= @$alumni->province_id == $r->province_id ? ' selected="selected"' : "" ?>><?= $r->province_nama ?></option>
                <? } ?>
                </select>
                <font class="strerr"><?=@$err->province_id?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddKotadomisili" class="control-label">Kota Domisili:</label>
            <div class="controls">
                <select name="ddKotadomisili" id="ddKotadomisili">
                <option value="">Select</option>
                <? foreach (getKabupaten(@$alumni->province_id) as $r) { ?>
                    <option value="<?= $r->city_id ?>"<?= @$alumni->city_id == $r->city_id ? ' selected="selected"' : "" ?>><?= $r->city_nama ?></option>
                <? } ?>
            </select>
            <font class="strerr"><?=@$err->city_id?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtZipdomisili" class="control-label">Kode Pos Domisili:</label>
            <div class="controls">
                <input type="text" name="txtZipdomisili" id="txtZipdomisili" value="<?= @$alumni->up_zipcode ?>" class="span2"/>
                <font class="strerr"><?=@$err->up_zipcode?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtAyah" class="control-label">Nama Ayah:</label>
            <div class="controls">
                <input type="text" name="txtAyah" id="txtAyah" value="<?= @$alumni->up_father ?>" class="span4"/>
            <font class="strerr"><?=@$err->up_father?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtIbu" class="control-label">Nama Ibu:</label>
            <div class="controls">
                <input type="text" name="txtIbu" id="txtIbu" value="<?= @$alumni->up_mother ?>" class="span4"/>
            <font class="strerr"><?=@$err->up_mother?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddStatus" class="control-label">Alamat Asal:</label>
            <div class="controls">
                <input type="text" name="txtAlamatasal" id="txtAlamatasal" value="<?= @$alumni->up_home_address ?>" class="span4"/>
            <font class="strerr"><?=@$err->up_home_address?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddPropinsiasal" class="control-label">Propinsi Asal:</label>
            <div class="controls">
                <select name="ddPropinsiasal" id="ddPropinsiasal">
                <option value="">Select</option>
                <? foreach (getPropinsi() as $r) { ?>
                    <option value="<?= $r->province_id ?>"<?= @$alumni->up_home_province_id == $r->province_id ? ' selected="selected"' : "" ?>><?= $r->province_nama ?></option>
                <? } ?>
                </select>
                <font class="strerr"><?=@$err->province_id?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="ddKotaasal" class="control-label">Kota Asal:</label>
            <div class="controls">
                <select name="ddKotaasal" id="ddKotaasal">
                    <option value="">Select</option>
                    <? foreach (getKabupaten(@$alumni->up_home_province_id) as $r) { ?>
                        <option value="<?= $r->city_id ?>"<?= @$alumni->up_home_city_id == $r->city_id ? ' selected="selected"' : "" ?>><?= $r->city_nama ?></option>
                    <? } ?>
                </select>
            <font class="strerr"><?=@$err->up_home_city_id?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtZipasal" class="control-label">Kode Pos Asal:</label>
            <div class="controls">
                <input type="text" name="txtZipasal" id="txtZipasal" value="<?= @$alumni->up_home_zipcode ?>" class="span2"/>
                <font class="strerr"><?=@$err->up_home_zipcode?></font>
            </div>
        </div>
        <div class="control-group">
            <label for="txtTlpAsal" class="control-label">Telp. Asal:</label>
            <div class="controls">
                <input type="text" name="txtTlpAsal" id="txtPhone" value="<?= @$alumni->up_home_phone ?>"/>
                <font class="strerr"><?=@$err->up_home_phone?></font>
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <input type="submit" value="Simpan" class="btn btn-primary" />
                <a class="btn btn-default" href="<?= base_url() ?>profile">Batal</a>
            </div>
        </div>
        
    </fieldset>
    

</form>


<script>
    jQuery(document).ready(function($){
        $('#ddPropinsiasal').change(function(){
            $('#ddKotaasal').empty();
            $.post('<?= base_url() . "region/kabupaten" ?>', {id:$('#ddPropinsiasal').val()}, function(data) {
                if(data){
                    var datajs = $.parseJSON(data);
                    $('<option value="">Select</option>').appendTo("#ddKotaasal");
                    $.each(datajs, function(key, value){
                        $("<option value='"+value.cityid+"'>"+value.citynama+"</option>").appendTo("#ddKotaasal");
                    });
                }
            });
        });
        $('#ddPropinsidomisili').change(function(){
            $('#ddKotadomisili').empty();
            $.post('<?= base_url() . "region/kabupaten" ?>', {id:$('#ddPropinsidomisili').val()}, function(data) {
                if(data){
                    var datajs = $.parseJSON(data);
                    $('<option value="">Select</option>').appendTo("#ddKotadomisili");
                    $.each(datajs, function(key, value){
                        $("<option value='"+value.cityid+"'>"+value.citynama+"</option>").appendTo("#ddKotadomisili");
                    });
                }
            });
        });
    });
	
</script>